package com.songlanyun.modules.order.model.dto;

import com.songlanyun.common.drive.ValueObject;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class SubmitOrderUseCoupon implements ValueObject {

    /**
     * 我的优惠券id
     */
    private Long myCouponId = 0L;

    /**
     * 优惠券Id
     */
    private Long couponId = 0L;

    /**
     * 优惠券名称
     */
    private String couponName = "无可使用券";

    /**
     * 优惠券面额
     */
    private BigDecimal couponFaceValue = BigDecimal.ZERO;

    /**
     * 优惠券实际优惠多少(对于支付订单，店铺订单，实际的商品子订单)
     */
    private BigDecimal couponResultValue = BigDecimal.ZERO;


    /**
     * 是否选择了或系统推荐了可以使用的优惠券
     * @return
     */
    public Boolean isExistsCoupon()
    {
        return this.couponId >0 ;
    }


    public static SubmitOrderUseCoupon buildEmpty()
    {
        return new SubmitOrderUseCoupon();
    }
}
